using N2;
using N2.Details;
using N2.Integrity;

namespace Dinamico.Models
{
    /// <summary>
    /// This class represents the data transfer object that encapsulates 
    /// the information used by the template.
    /// </summary>
    [PageDefinition("Template Edit gesamte Seite.",
        Description = "Template Edit whole page content.",
        ToolTip = "Template Edit whole page content.",
        SortOrder = 3,
        IconUrl = "~/upload/img/icons/ContentPage3.png")]
    [WithEditableTitle, WithEditableName]
    [RestrictParents(typeof(Models.DescribePageModel), typeof(Models.RedirectToFirstChildModel))]
    [AvailableZone("Left Column", "LeftZone")]
    [AvailableZone("Center Column", "CenterZone")]
    [AvailableZone("Right Column", "RightZone")]

    [AvailableZone("Left Column Down", "LeftZoneDown")]
    [AvailableZone("Center Column Down", "CenterZoneDown")]
    [AvailableZone("Right Column Down", "RightZoneDown")]

    public class DescribePageModel : BaseDescribePage
    {
        [EditableFreeTextArea("Left content", 100)]
        public virtual string LeftText { get; set; }

        [EditableFreeTextArea("Right content", 100)]
        public virtual string RightText { get; set; }

        [EditableFreeTextArea(Title="Page kaywords" ,SortOrder =2,Rows =1 ,HelpText="Plain text")]
        public virtual string Keywords
        {
            get;
            set;
        }




        //[EditableImage]
        //public virtual string Image { get; set; }

        //public enum Background
        //{
        //    Background,
        //    Image
        //}
        //public string Answer;
        //[EditableEnum("Enum", 1, typeof(Background))]
        //public Background BackgroundList
        //{
        //    get { return (Background)(GetDetail("BackgroundList") ?? Background.Background); }
        //    set
        //    {
        //        SetDetail("BackgroundList", value, Background.Background);
        //        GetAnswer(value);
        //    }
        //}

        //private void GetAnswer(Background bg)
        //{
        //    if (bg.ToString() == "Background")
        //        Answer = "Background";
        //    else
        //        Answer = "Image";
        //}
    }
}




